package com.wry.wry_test.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @Author: wangrongyi
 * @Date: 2024/9/30 10:46
 * @Description:
 */
@Component
@Slf4j
public class CommandInitConfig implements CommandLineRunner {

    @Override
    public void run(String... args) throws Exception {

//        log.info("CommandInitConfig执行了");
//
//        for (String arg : args) {
//            log.info("arg = {}", arg);
//        }
//
//
//        new Thread(() -> {
//            while (true){
//                printMsg();
//            }
//
//        },"日志测试").start();

    }

    public static void printMsg(){
        log.info("日志测试info");
        log.debug("日志测试debug");
        log.error("日志测试error");
        log.warn("日志测试warn");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
